package com.cw.jeeyt.api.enums;

import java.util.Arrays;

/**
 * 参数类型枚举
 */
public enum EnumFieldType {
    FIELD("field", "字段"),
    CLASS("class", "类");
    private String code;
    private String desc;

    EnumFieldType(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static EnumFieldType find(String code) {
        return Arrays.stream(EnumFieldType.values())
            .filter(input -> input.getCode()
                .equals(code))
            .findFirst()
            .orElse(null);
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
